/*
 * Copyright (c) 2008 centrevillage <centrevillage@gmail.com>
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

// ravi
#include "types.hpp"
#include "functions.hpp"
#include "evaluates.hpp"
#include "editor_functions.hpp"
#include "compiler.hpp"

#include "editor_script.h"

using namespace ravi;

void init_compiler_for_editor(compiler& c) {
    // editor functions
    c.def_system_val("event", make_val(new nfn_t(&editor_chevent, 1, FARG_GREATER_EQ)));
    c.def_system_val("e",     make_val(new nfn_t(&editor_chevent, 1, FARG_GREATER_EQ)));
    c.def_system_val("track", make_val(new nfn_t(&editor_track, 1)));
    c.def_system_val("t",     make_val(new nfn_t(&editor_track, 1)));
    c.def_system_val("add_screen", make_val(new nfn_t(&editor_ascr, 0)));
    c.def_system_val("as",   make_val(new nfn_t(&editor_ascr, 0)));
    c.def_system_val("delete_screen", make_val(new nfn_t(&editor_dscr, 1, FARG_LESS_EQ)));
    c.def_system_val("ds",   make_val(new nfn_t(&editor_dscr, 1, FARG_LESS_EQ)));
    c.def_system_val("register_custom_editor", make_val(new nfn_t(&editor_register_editor, 3)));
    c.def_system_val("alert", make_val(new nfn_t(&editor_alert, 1)));
    c.def_system_val("screen", make_val(new nfn_t(&editor_screen, 1, FARG_LESS_EQ)));
    c.def_system_val("scrollbind", make_val(new nfn_t(&editor_scrollbind, 0)));
    c.def_system_val("sb", make_val(new nfn_t(&editor_scrollbind, 0)));
    c.def_system_val("noscrollbind", make_val(new nfn_t(&editor_noscrollbind, 0)));
    c.def_system_val("nosb", make_val(new nfn_t(&editor_noscrollbind, 0)));
    c.def_system_val("play", make_val(new nfn_t(&editor_play, 1, FARG_LESS_EQ)));
    c.def_system_val("p", make_val(new nfn_t(&editor_play, 1, FARG_LESS_EQ)));
    c.def_system_val("note_screen", make_val(new nfn_t(&editor_note_screen, 0)));
    c.def_system_val("ns", make_val(new nfn_t(&editor_note_screen, 0)));
    c.def_system_val("event_screen", make_val(new nfn_t(&editor_event_screen, 0)));
    c.def_system_val("es", make_val(new nfn_t(&editor_event_screen, 0)));
    c.def_system_val("lyric_screen", make_val(new nfn_t(&editor_lyric_screen, 0)));
    c.def_system_val("ls", make_val(new nfn_t(&editor_lyric_screen, 0)));
    c.def_system_val("custom_screen", make_val(new nfn_t(&editor_custom_screen, 1)));
    c.def_system_val("cs", make_val(new nfn_t(&editor_custom_screen, 1)));
    c.def_system_val("focused_screen_id", make_val(new nfn_t(&editor_focused_screen_id, 0)));
    c.def_system_val("fsid", make_val(new nfn_t(&editor_focused_screen_id, 0)));
    c.def_system_val("open_vst_editor", make_val(new nfn_t(&editor_open_vst_editor, 1, FARG_LESS_EQ)));
    c.def_system_val("ove", make_val(new nfn_t(&editor_open_vst_editor, 1, FARG_LESS_EQ)));
    c.def_system_val("register_keymap", make_val(new nfn_t(&editor_register_keymap, 4)));
    c.def_system_val("change_pixel_per_4", make_val(new nfn_t(&editor_change_pp4, 1)));
    c.def_system_val("chpp4", make_val(new nfn_t(&editor_change_pp4, 1)));

}
